package com.changy.ai_tutor_for_dm.mapper;

import com.changy.ai_tutor_for_dm.entity.Tag;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface TagsMapper {

    // 查询所有二级标签 封装到Tag对象数组
    List<Tag> getTags(String category);

    // 添加标签
    @Insert("insert into tags (tag_name, category) values (#{tagName}, #{category})")
    void insert(Tag tag);

    // 删除标签
    @Delete("delete from tags where id = #{id}")
    void delete(Integer id);

    // 修改标签
    @Update("update tags set tag_name = #{tagName}, category = #{category} where id = #{id}")
    void update(Tag tag);
}
